<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortletAdmin.php 454 2011-01-07 22:53:37Z steen.rabol $
 *
 */

Prado::using('Application.Common.PortalAdminPage');

class PortletAdmin extends PortalAdminPage
{
	public function onLoad($param)
	{
		$this->PageTitle = "About";
		//
		// 'Hack' as the JsCookMenuPortlet is used as Admin menu, we need to rename it to make it work.
		//
		if($this->Request['portlet'] == "JsCookMenuPortlet")
		{
			$pName			= 'a' . $this->Request['portlet'];
			$portletPath	= 'Application.Portlets.' . $this->Request['portlet'] . '.Admin.a' . $this->Request['portlet'];
		}
		else
		{
			$pName			= $this->Request['portlet'];
			$portletPath	= 'Application.Portlets.' . $this->Request['portlet'] . '.Admin.' . $this->Request['portlet'];
		}

		Prado::using($portletPath);
		$ctrl	= $this->Master->findControl('Main');
		if($ctrl)
		{
			$ctrl->Controls[] = new $pName;
		}
		parent::onLoad($param);
	}
}
?>